package com.ebupt.migu.banner2.controller;

import com.ebupt.migu.banner2.entity.ApiQueryBean;
import com.ebupt.migu.banner2.entity.ResultMsg;
import com.ebupt.migu.banner2.service.Banner2Service;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author tz
 */
@RestController
@RequestMapping("/api")
public class Banner2Controller {

    @Resource
    private Banner2Service banner2Service;

    @PostMapping("/query")
    public ResultMsg getBanner(@Validated @RequestBody ApiQueryBean bean) {
        return banner2Service.query(bean);
    }
}
